The present invention relates to an apparatus for writing data, and more particularly, to an apparatus for writing data to various types of digital versatile disc (DVD) media, such as a DVD-R or a DVD-RW.
FIG. 1 is a schematic block diagram of a DVD-R medium data writing apparatus 100. The data writing apparatus 100 includes a microprocessor unit (MPU) 1, a controller controlled by the MPU 1, a buffer memory 3, a write channel 4, and a pickup 5. The controller 2 receives data from a host computer via an interface and processes the data. The processed data is stored in the buffer memory 3.
The controller 2 reads the data stored in the buffer memory 3 and provides the data and a clock signal to the write channel 4. The write channel 4 writes the data to a DVD-R medium 6 by means of a pickup 5.
As shown in FIG. 2, the controller 2 includes a host interface 7, an error corrector 10, and a formatter 20. The host interface 7 receives data, which is transferred from the host computer 8, and stores the data in the buffer memory 3. When the buffer memory 3 stores 32 Kbytes, or one block, of data, a host pointer 9 of the host interface 7 updates a pointer value and provides the updated value to the error corrector 10.
When the value of the host pointer 9 differs from the value of the error correction pointer 11, the error corrector 10 determines that 32 Kbytes of data is stored in the buffer memory 3 and reads the data from the buffer memory 3. The error corrector 10 generates an error detection code and scrambles the read data to generate data that complies with a DVD format. The DVD format data is then re-written to the buffer memory 3.
The operation of the error corrector 10 will now be discussed in detail with reference to FIGS. 3 and 4. Referring to FIG. 3, a single block 12 has 16 sectors 13, an error correction code PO, which has a length of 16 bytes in the vertical direction, and an error correction code PI, which has a length of 10 bytes in the horizontal direction. Each sector 13 includes six bytes of an ID section 14, six bytes of a copyright management information (CPR-MAI) section 15, two Kbytes of user data 16, and four bytes of an error detection code (EDC) section 17.
Referring to FIG. 5, the ID section 14 has one byte of sector information 18 and three bytes of sector addresses 19a, 19b, 19c. The ID section 14 also includes two bytes of a detection code, which is used to determine whether an error is included in the read ID section 14.
The CPR-MAI section 15 is used to restrict copying.
The EDC section 17 stores an error detection code, which is obtained by calculating the data included between the ID section 14 and the final byte of the user data 16.
The ID section 14 and the CPR-MAI section 15 are normally set in a register of the error corrector 10 or a predetermined area of the buffer memory 3. The ID section 14 and the CPR-MAI section 15 are used as part of the data when the error detection code or the error correction code is generated.
The generation of the error correction codes PI, PO will now be discussed. Referring to FIG. 4, the error corrector 10 first reads user data from the buffer memory 3 and uses the ID section 14 and the CPR-MAI section 15, which are stored in the error corrector 10, to generate an error detection code that is to be stored in the EDC section 17 (step S1).
The error corrector 10 then re-writes the data to the error corrector 10 (step S2). In this state, the user data 16 is scrambled. In the scrambling process, for example, an exclusive OR operation is performed with the data and a value obtained through a predetermined formula.
After the processing of step S2 is performed for 16 sectors, the error corrector 10 reads data from the buffer memory 3 again (step S3) and generates the error correction codes PI, PO. The error corrector 10 re-writes a block of data, to which the error correction codes PI, PO are added, to the buffer memory 3 (step S4). In this state, the error correction codes PI, PO must be generated separately from each other. Thus, steps S3 and S4 are repeated twice.
When the generation of the error correction codes PI, PO is completed; the error corrector 10 updates the value of the error correction pointer 11 and provides the updated value to the formatter 20.
When the updated value of the error correction pointer 11 differs from the value of a disc control pointer 21 of the formatter 20, the formatter 20 reads a block of data from the buffer memory 3 and writes the data to the DVD-R medium 6.
Comparison between the value of the error correction pointer 11 and the value of the disc control pointer 21 in the formatter 20 is performed when the writing of the block starts. When there is no difference between the value of the pointer 11 and the value of the pointer 21, this indicates that the generation of the error correction codes PI, PO in the error corrector 10 was not on time. In such a case, the data that is to be written to the medium 6 is not stored in the buffer memory 3. Thus, the formatter 20 determines that a data empty state has occurred and suspends the writing process.
A characteristic process that is performed when data is written to the DVD-R medium 6 will now be discussed. When writing data to the DVD-R medium 6, the data processing of a linking loss area, the bit adding of a data ID section, and the writing of data to a linking portion must be performed.
The linking portion refers to a connecting portion between the terminal end of the previously written data and the first end of the data that is to be written next. The linking portion is used so that connecting portions are smoothly reproduced during reproduction of written data.
Referring to FIG. 6, the final portion of the final block B1 of the previously written data must be extended to a position that is somewhat advanced from the head of a head block B2 of further data that is to be written. The final block B1 is written up to a final end BE, which is extended from a final end DE of the data by a length corresponding to a linking portion 23. The linking portion 23 includes a sync mark SYNC, ID section data, and 00h data. The head block B2 of the further data must be written within several bytes of the final end BE of the previously written data.
The final block B1 and the head block B2 must be provided with a linking loss area. Although a single block of DVD data consists of 32 Kbytes (16 sectors), when the total data amount of the data that is to be written cannot be equally divided by 32 Kbytes, linking loss areas are provided in the final block B1 and the head block B2.
The linking loss area may be a 32k link, which is shown in FIG. 7(a), or a 2k line, which is shown in FIG. 7(b). The 32k link is used when the valid sector data of the final block B1 is less than 16 sectors. In such a case, the linking loss area is formed from the insufficient data sectors and the 16 sectors of the head block B2 of the further data that is to be written next.
The 2K link is used when the valid sector data of the final block B1 is less than 16 sectors. In this case, the linking loss area is formed from the insufficient data sectors and the two sectors of the head block B2 of the further data that is to be written next.
FIG. 7(c) shows an example in which the final block B1 has exactly 16 sectors of valid sector data and a linking loss area is not provided in the following head block. Such a case is referred to as a loss-less link.
The padding of 00h data in the user data section of each sector forming the linking loss area is standardized. Further, when a linking loss area is formed, “1” must be set at the 25th bit (data type) of the ID section of some sectors.
In the 32k link of FIG. 7(a), subject sectors OS to which “1” is set at the 25th bit are the final sector storing valid sector data and the insufficient data sectors in the final block B1 and the sectors excluding the head and final sectors of the linking loss area in the head block B2. In the 2k link of FIG. 7(b), “1” is set at the 25th bit of the final sector storing valid sector data and the insufficient data sectors in the final block B1.
The MPU 1 controls the writing completion process of the DVD-R medium 6. The completion process will now be discussed with reference to FIG. 8.
When the MPU 1 detects the completion timing of the data transferred from the host computer (step S11), the MPU 1 performs a padding process to write 00h data to the insufficient data sectors of the final block B1 (step S12).
The padding process is performed by preparing hardware for writing 00h to the insufficient data sectors or by writing 00h to the insufficient data sectors in the buffer memory 3.
Then, since the setting of the data type to the 25th bit of the ID section 14 is necessary, the MPU 1 instructs the error corrector 10 to set the data type bits (step S13).
The MPU 1 then instructs the error corrector 10 to generate an error correction code. The MPU 1 updates the host pointer 9 of the host interface 7 to instruct the generation of the error correction code (step S14). Then, the error corrector 10 generates an error correction code of the final block B1.
After the generation of the error correction code is completed, the MPU 1 generates the data of the linking portion 23 (step S15) and updates the value of the block counter 22 of the formatter 20 (steps S16, S17).
In step S16, an updating process of the block counter 22 is performed so that the timing the MPU 1 updates the block counter 22 does not coincide with the timing the formatter 20 updates the block counter 22. This prevents erroneous operations during the updating process of the block counter 22.
The formatter 20 determines the write completion position from the value of the block counter 22 and performs the linking process to complete the writing process.
The operation of the formatter 20 during the writing completion process will now be discussed with reference to FIG. 9.
The formatter 20 performs the data writing process on the DVD-R medium 6 in a block by block manner. Whenever the formatter 20 completes the writing process of each block, the formatter 20 checks whether or not the data of the block that will undergo the next writing process is valid. More specifically, when the writing process of one block is completed (step S21), the formatter 20 checks the value of the block counter 22 (step S22). If the value is greater than “1”, the formatter 20 checks whether or not the data of the next block that is to be write-processed is valid (step S23).
To check the data, the formatter 20 compares the value of the error correction pointer 11 of the error corrector 10 with the value of its disc control pointer 21. If the values do not coincide with each other, the formatter 20 determines that the data that is to be write-processed is stored in the buffer memory 3. In this case, the formatter 20 subtracts “1” from the value of the block counter 22 (step S24) and returns to step S21 to perform the writing process on the next block.
In step S23, if the value of the pointer 11 and the value of the pointer 21 are substantially the same, the formatter 20 determines that data that is to be write-processed is not yet stored in the buffer memory 3 and detects a data empty error (step S25). This completes the writing process.
In step S22, if the value of the block counter 22 is “1” or less, the formatter 20 determines that the writing process of the final block B1 has been completed. Thus, the formatter 20 performs the writing process on the linking portion 23 (step S26) and completes the writing process.
When the DVD-R medium 6 undergoes the above writing completion process, the MPU 1 must perform the 00h padding process on the linking loss area, set the data type in the ID section 14 of the subject sector in the linking loss area, instruct the generation of the error correction code, generate the data written to the linking portion 23, and instruct the formatter 20 to complete the writing process. In other words, in the writing process for the DVD-R medium 6, the data transfer amount is not known beforehand. Thus, the above writing completion process must be performed after receiving a transfer completion command from the host computer 8.
When it takes time to perform the above writing completion operation, a data empty error may occur in the formatter 20. Data cannot be re-written to the DVD-R medium 6. Thus, when a data empty error occurs, the data that has been written is discarded. Further, data must be re-written to a new area from the beginning. Accordingly, when a data empty error occurs, the data write processing efficiency decreases.